/*
 * @Author: zhuxiaoyi
 * @Date: 2024-01-23 14:42:59
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2024-12-18 16:51:46
 * @Description:
 */
import { ApiProperty } from '@midwayjs/swagger';

export class GetAlgorithmsDto {
  @ApiProperty({
    example: '1',
    description: '页码',
  })
  page_index: number;

  @ApiProperty({
    example: '1',
    description: '页码长度',
  })
  page_size: number;

  @ApiProperty({
    description: '算法关键词',
  })
  keyword: string;

  @ApiProperty({
    description: '算法类型',
    example: 3,
  })
  type?: string;

}
export class TypeDto {

  @ApiProperty({
    description: '算法类型',
    example: ['3', '4'],
  })
  type?: string[];

}

export class CreateAlgorithmDto {
  @ApiProperty({
    example: 'Example Algorithm',
    description: '算法名称',
  })
  name: string;

  @ApiProperty({
    example: 'example-identifier',
    description: '算法标识符',
  })
  identifier: string;

  @ApiProperty({
    example: 'This is an example algorithm description.',
    description: '算法描述',
  })
  description: string;

  @ApiProperty({
    example: '1.0',
    description: '算法版本',
  })
  version: string;

  @ApiProperty({
    example: 'AI',
    description: '应用程序',
  })
  application: string;

  @ApiProperty({
    example: 'Linux',
    description: '操作系统',
  })
  operating_system: string;

  @ApiProperty({
    example: '[{"param_name":"AlgoName","default_value":"RS2RGB","zh_name":"算法标识"},{"param_name":"inputFile","default_value":"G:/10水资源2024/哨兵2_202405/sample/batch.json","zh_name":"输入文件"},{"param_name":"outputFile","default_value":"G:/10水资源2024/哨兵2_202405/sample/sample.shp","zh_name":"输出文件"}]',
    description: '参数 (JSON 字符串)',
    required: false,
  })
  parameters?: string;

  @ApiProperty({
    example: 1,
    description: '执行类型 (例如：0 表示同步，1 表示异步)',
    required: false,
  })
  executeType?: number;

  @ApiProperty({
    example: true,
    description: '是否允许异步执行',
    required: false,
  })
  allowAsync?: boolean;

  @ApiProperty({
    example: 10,
    description: '并行执行的最大数量',
    required: false,
  })
  Parallel?: number;

  @ApiProperty({
    example: ['3', '4'],
    description: '算法类型列表',
    required: false,
    type: [String], // 指定数组类型
  })
  type?: string[];
}


export class UpdateAlgorithmsDto {

  @ApiProperty({
    example: 'New Algorithm Name',
    description: '算法名称',
  })
  name?: string;

  @ApiProperty({
    example: 'new_identifier',
    description: '算法标识符',
  })
  identifier?: string;

  @ApiProperty({
    example: 'New algorithm description',
    description: '算法描述',
  })
  description?: string;

  @ApiProperty({
    example: '2.0',
    description: '算法版本',
  })
  version?: string;

  @ApiProperty({
    example: 'New Application',
    description: '应用程序',
  })
  application?: string;

  @ApiProperty({
    example: 'windows',
    description: '操作系统',
  })
  operating_system?: string;

  @ApiProperty({
    example: '{"param1": "value1", "param2": "value2"}',
    description: '参数',
  })
  parameters?: string;

}

//前后时相数据匹配
export class ChangeFileMatchsDto {

  @ApiProperty({
    example: 'ChangeFileMatchs',
    description: '算法标识',
  })
  AlgoName?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/Q',
    description: '前时相文件',
  })
  QDir?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/H',
    description: '后时相文件',
  })
  HDir?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/result/20200914_20230820.csv',
    description: '匹配成果',
  })
  outputFile?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰基础数据/district.shp',
    description: '监测范围矢量',
  })
  MonitorShp?: string;

  @ApiProperty({
    example: 'dt_adcode',
    description: '过滤条件字段',
  })
  MonitorField?: string;

  @ApiProperty({
    example: '654301;654321',
    description: '过滤条件值”',
  })
  MonitorValue?: string;
}

//智能变化检测
export class ChangeAutoDetectDto {

  @ApiProperty({
    example: 'ChangeAutoDetect',
    description: '算法标识',
  })
  AlgoName?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/result/20200914_20230820.csv',
    description: '匹配成果',
  })
  inputFile?: string;

  @ApiProperty({
    example: '1',
    description: '深度学习模型',
  })
  OBJID?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰基础数据/district.shp',
    description: '监测范围矢量',
  })
  MonitorShp?: string;

  @ApiProperty({
    example: 'dt_adcode',
    description: '过滤条件字段',
  })
  MonitorField?: string;

  @ApiProperty({
    example: '654301;654321',
    description: '过滤条件值”',
  })
  MonitorValue?: string;

}

//成果合成导出
export class VecChangeUnionDto {

  @ApiProperty({
    example: 'VecChangeUnion',
    description: '算法标识',
  })
  AlgoName?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/result/20200914_20230820.csv',
    description: '匹配结果',
  })
  inputFile?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/result/OutShp_Change_20240820101214.shp',
    description: '智能解译成果文件',
  })
  outputFile?: string;

  @ApiProperty({
    example: '0',
    description: '图斑状态',
  })
  Status?: string;
}

//智能变化检测(单个文件) 
export class DetectDto {

  @ApiProperty({
    example: 'Detect',
    description: '算法标识',
  })
  AlgoName?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/Q/GF6_PMS_E87.5_N47.6_20200914_L5A_1120035897.tif',
    description: '前时相文件',
  })
  QFile?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/H/GF6_PMS_E88.0_N47.6_20230820_L5A_1420344697.tif',
    description: '后时相文件',
  })
  HFile?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/model_20240805/train_result_2mbuild_v1.model',
    description: '深度学习模型文件',
  })
  MDFile?: string;

  @ApiProperty({
    example: 'D:/2024_阿勒泰项目实施/阿勒泰2m数据/result/OutShp_Change_20240820101214_result.shp',
    description: '检测结果',
  })
  ChangeFile?: string;

  @ApiProperty({
    example: '8',
    description: '显存大小',
  })
  DISPLAYMEM?: string;

  @ApiProperty({
    example: '20',
    description: '无效去除率',
  })
  REMOVEPERCENT?: string;

  @ApiProperty({
    example: '200',
    description: '最小图斑面积',
  })
  MINSIZEPATCH?: string;

  @ApiProperty({
    example: '0',
    description: '最小图斑长度',
  })
  MINLENPATCH?: string;

}

export class taskDto {

  @ApiProperty({
    example: '88',
    description: '任务id',
  })
  id: number;

  @ApiProperty({
    example: '2',
    description: '任务状态 1-成功 2-执行中 3-失败 ',
  })
  status: number;

  @ApiProperty({
    example: '50',
    description: '任务进度 1-100',
  })
  progress: number;
}

export class ResponseDto {
  @ApiProperty({
    example: true,
    description: '是否成功',
  })
  success: boolean;

  @ApiProperty({
    example: '成功',
    description: '描述信息',
  })

  message: string;

  @ApiProperty({
    example: {
      "id": 88,
      "status": 2,
      "progress": 50
    },
    description: '响应数据',
  })
  data: taskDto;

}



